//
//  YPPayBackPlanViewController.m
//  ChengHuiTong
//
//  Created by ypwl on 15/11/4.
//  Copyright © 2015年 张文权. All rights reserved.
//

#import "YPPayBackPlanViewController.h"
#import "DQDScrollContentView.h"
#import "YPPayBackItemView.h"
#import "YPInvestDetailViewController.h"
@interface YPPayBackPlanViewController ()<DQDScrollContentViewDataSource>

@end

@implementation YPPayBackPlanViewController{

    NSArray *_titlesArray;
    DQDScrollContentView *_contentView;
    
}

#pragma mark--生命周期
- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.title=@"回款明细";
    
    _titlesArray = @[@"还款中",@"已还款"];

    [self setUpUI];
}

- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    
    [MobClick beginLogPageView:@"回款明细"];
}

- (void) viewWillDisappear:(BOOL)animated{
    
    [super viewWillDisappear:animated];
    
    [MobClick endLogPageView:@"回款明细"];
    
}

- (void)setUpUI{
    
    _contentView = [[DQDScrollContentView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64) topScrollEnabled:NO showTopScrollLine:NO];
    _contentView.dataSource = self;
    [self.view addSubview:_contentView];
}

#pragma mark --DQDScrollContentViewDataSource
- (NSArray *)homeViewWithTitleArray{
    
    return _titlesArray;
}

- (DQDScrollContentItemView *)homeViewItemWithContentViewWithIndex:(NSInteger)index{
    
    YPPayBackItemView *contentItemView = [YPPayBackItemView new];
    WeakSelf
    contentItemView.goDetailBlock = ^(MyReturnDetail *model){
        
        YPInvestDetailViewController * investDetailVC = [[YPInvestDetailViewController alloc]init];
        YPInvestModel *investmodel = [[YPInvestModel alloc]init];
        investmodel.bid = model.bid;
        investmodel.title = model.title;
        investDetailVC.investModel = investmodel;
        [weakSelf.navigationController pushViewController:investDetailVC animated:YES];
    };
    return contentItemView;
}


@end
